<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Copy data from table into file</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="pdo.pgsqlcopytoarray.html">« PDO::pgsqlCopyToArray</a></li>
      <li style="float: right;"><a href="pdo.pgsqlgetnotify.html">PDO::pgsqlGetNotify »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.pdo-pgsql.html">PostgreSQL (PDO)</a></li>
    <li>Copy data from table into file</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="pdo.pgsqlcopytofile" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PDO::pgsqlCopyToFile</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.3, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">PDO::pgsqlCopyToFile</span> &mdash; <span class="dc-title">Copy data from table into file</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-pdo.pgsqlcopytofile-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>PDO::pgsqlCopyToFile</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$table_name</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$delimiter</code><span class="initializer"> = &quot;\t&quot;</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$null_as</code><span class="initializer"> = &quot;\\\\N&quot;</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$fields</code><span class="initializer"> = ?</span></span><br>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Copies data from table into file specified by <code class="parameter">filename</code>
   using <code class="parameter">delimiter</code> as fields delimiter and <code class="parameter">fields</code> list
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-pdo.pgsqlcopytofile-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">table_name</code></dt>

     <dd>

      <p class="para">
       String containing table name
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">filename</code></dt>

     <dd>

      <p class="para">
       Filename to export data
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">delimiter</code></dt>

     <dd>

      <p class="para">
       Delimiter used in file specified by <code class="parameter">filename</code>
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">null_as</code></dt>

     <dd>

      <p class="para">
       How to interpret null values
      </p>
     </dd>

    
        
     <dt>
<code class="parameter">fields</code></dt>

     <dd>

      <p class="para">
       List of fields to insert
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-pdo.pgsqlcopytofile-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>true</code></strong> on success, 或者在失败时返回 <strong><code>false</code></strong>.
  </p>
 </div>

</div></div></div></body></html>